﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ContentEditor.aspx.cs" Inherits="ContentEditor" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Content Editor</title>

    <script type="text/javascript">
        //A function that will return a reference to the parent radWindow in case the page is loaded in a RadWindow object
        function getRadWindow() {
            var oWindow = null;
            if (window.radWindow) oWindow = window.radWindow;
            else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
            return oWindow;
        }
    </script>

</head>
<body class="contentEditor">
    <form id="frmEditor" runat="server">
    <telerik:RadStyleSheetManager ID="rssEditor" runat="server" />
    <telerik:RadScriptManager ID="smEditor" runat="server" EnableTheming="True" />
    <telerik:RadFormDecorator ID="rfdEditor" runat="server" Skin="Telerik" DecoratedControls="CheckBoxes, RadioButtons" />
    <telerik:RadAjaxPanel runat="server" ID="rapnlEditor" HorizontalAlign="NotSet" LoadingPanelID="ralEditor">
        <telerik:RadEditor ID="reSiteWorxEditor" runat="server" Skin="Telerik" ToolsWidth="100px"
            EnableResize="False" AutoResizeHeight="False" OnPreRender="reSiteWorxEditor_PreRender"
            Width="99%" OnClientLoad="SetContentCssClass">
            <DocumentManager DeletePaths="~/Files/Documents" UploadPaths="~/Files/Documents"
                ViewPaths="~/Files/Documents" />
            <MediaManager DeletePaths="~/Files/Media" ViewPaths="~/Files/Media" />
            <ImageManager DeletePaths="~/Files/Images" UploadPaths="~/Files/Images" ViewPaths="~/Files/Images" />
            <TemplateManager DeletePaths="~/Files/Templates" UploadPaths="~/Files/Templates" />
            <FlashManager DeletePaths="~/Files/Flash" UploadPaths="~/Files/Flash" ViewPaths="~/Files/Flash" />
            <Content></Content>
        </telerik:RadEditor>
        <asp:HiddenField runat="server" ID="hidContentCssClass" />

        <script type="text/javascript">
            function SetContentCssClass(editor) {
                var hidClassName = document.getElementById('hidContentCssClass');
                if (hidClassName.value.length > 0) {
                    editor.get_document().body.className = hidClassName.value;
                }
            }
        </script>

        <table border="0">
            <tr>
                <td>
                    <asp:Button runat="server" ID="btnSave" Text="Save" OnClick="btnSave_Click" SkinID="Admin" />
                    &nbsp;<asp:Button runat="server" ID="btnCancel" Text="Cancel" SkinID="Admin" OnClick="btnCancel_Click" />
                </td>
            </tr>
        </table>
    </telerik:RadAjaxPanel>
    <telerik:RadAjaxLoadingPanel ID="ralEditor" runat="server" Height="75px" Width="75px"
        Style="position: relative; top: -50%; left: 45%;" IsSticky="true">
        <img alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>'
            style="border: 0px;" />
    </telerik:RadAjaxLoadingPanel>
    </form>
</body>
</html>
